Skip to content

Conversation

@jhamon
Copy link
Collaborator

@jhamon jhamon commented Jan 28, 2026

Summary

Add deployment model classes for different index deployment configurations.

Closes SDK-103

Classes

Class Deployment Type Key Parameters
ServerlessDeployment serverless cloud, region
ByocDeployment byoc environment
PodDeployment pod environment, pod_type, replicas, shards

Usage Example

from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment

# Serverless deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)

# BYOC deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)

# Pod deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=PodDeployment(
        environment="us-east-1-aws",
        pod_type="p1.x1",
        replicas=2,
    ),
)

Test Plan

  • Unit tests for ServerlessDeployment serialization
  • Unit tests for ByocDeployment serialization
  • Unit tests for PodDeployment with various options
  • mypy type checking passes

Note

Low Risk
Low risk: this PR only adds new model/dataclass types and exports them; it doesn’t change existing request flows, but downstream code may start relying on the new to_dict serialization format.

Overview
Adds new deployment configuration dataclasses (ServerlessDeployment, ByocDeployment, PodDeployment) with to_dict() serialization and a Deployment union type in db_control/models/deployment.py.

Exports these types through pinecone.db_control.models and top-level pinecone lazy imports, and adds unit tests validating constructor defaults and to_dict() output across deployment variants.

Written by Cursor Bugbot for commit c2e965d. This will update automatically on new commits. Configure here.

Add deployment model classes for different index deployment configurations:
- ServerlessDeployment: for serverless indexes with cloud and region
- ByocDeployment: for BYOC indexes with environment
- PodDeployment: for pod-based indexes with environment, pod_type, replicas, shards

Each class provides a to_dict() method that serializes to the API format.

Closes SDK-103
@jhamon jhamon marked this pull request as ready for review January 28, 2026 19:14
@jhamon jhamon added the enhancement New feature or request label Jan 28, 2026
@jhamon jhamon merged commit fdba5e4 into fts Jan 28, 2026
7 checks passed
@jhamon jhamon deleted the jhamon/sdk-103-deployment-model-classes branch January 28, 2026 19:18
jhamon added a commit that referenced this pull request Jan 28, 2026
## Summary

Add deployment model classes for different index deployment
configurations.

Closes SDK-103

## Classes

| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |

## Usage Example

```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment

# Serverless deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)

# BYOC deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)

# Pod deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=PodDeployment(
        environment="us-east-1-aws",
        pod_type="p1.x1",
        replicas=2,
    ),
)
```

## Test Plan

- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon added a commit that referenced this pull request Jan 28, 2026
## Summary

Add deployment model classes for different index deployment
configurations.

Closes SDK-103

## Classes

| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |

## Usage Example

```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment

# Serverless deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)

# BYOC deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)

# Pod deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=PodDeployment(
        environment="us-east-1-aws",
        pod_type="p1.x1",
        replicas=2,
    ),
)
```

## Test Plan

- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon added a commit that referenced this pull request Jan 28, 2026
## Summary

Add deployment model classes for different index deployment
configurations.

Closes SDK-103

## Classes

| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |

## Usage Example

```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment

# Serverless deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)

# BYOC deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)

# Pod deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=PodDeployment(
        environment="us-east-1-aws",
        pod_type="p1.x1",
        replicas=2,
    ),
)
```

## Test Plan

- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon added a commit that referenced this pull request Jan 28, 2026
## Summary

Add deployment model classes for different index deployment
configurations.

Closes SDK-103

## Classes

| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |

## Usage Example

```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment

# Serverless deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)

# BYOC deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)

# Pod deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=PodDeployment(
        environment="us-east-1-aws",
        pod_type="p1.x1",
        replicas=2,
    ),
)
```

## Test Plan

- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
jhamon added a commit that referenced this pull request Jan 28, 2026
## Summary

Add deployment model classes for different index deployment
configurations.

Closes SDK-103

## Classes

| Class | Deployment Type | Key Parameters |
|-------|-----------------|----------------|
| `ServerlessDeployment` | `serverless` | `cloud`, `region` |
| `ByocDeployment` | `byoc` | `environment` |
| `PodDeployment` | `pod` | `environment`, `pod_type`, `replicas`,
`shards` |

## Usage Example

```python
from pinecone import ServerlessDeployment, ByocDeployment, PodDeployment

# Serverless deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ServerlessDeployment(cloud="aws", region="us-east-1"),
)

# BYOC deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=ByocDeployment(environment="aws-us-east-1-b92"),
)

# Pod deployment
pc.create_index(
    name="my-index",
    schema=schema,
    deployment=PodDeployment(
        environment="us-east-1-aws",
        pod_type="p1.x1",
        replicas=2,
    ),
)
```

## Test Plan

- [x] Unit tests for ServerlessDeployment serialization
- [x] Unit tests for ByocDeployment serialization
- [x] Unit tests for PodDeployment with various options
- [x] mypy type checking passes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only adds new model/dataclass types and exports
them; it doesn’t change existing request flows, but downstream code may
start relying on the new `to_dict` serialization format.
>
> **Overview**
> Adds new deployment configuration dataclasses (`ServerlessDeployment`,
`ByocDeployment`, `PodDeployment`) with `to_dict()` serialization and a
`Deployment` union type in `db_control/models/deployment.py`.
>
> Exports these types through `pinecone.db_control.models` and top-level
`pinecone` lazy imports, and adds unit tests validating constructor
defaults and `to_dict()` output across deployment variants.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2e965d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant